﻿using System.Collections.Generic;
using System.ComponentModel;

namespace cndp.View
{
    public delegate void DelegateNewContest(
        string name, int id, string location, string startTime, string finishTime, string deadlineDate,
        string contestAdministrator);

    public delegate void DelegateDeleteContest(int id);

    public delegate void DelegateStartContest();

    public delegate void DelegateSaveContestToXmlFile(string fileName, int index);

    public delegate Model.Contest DelegateReadContestFromXmlFile(string fileName);
    
    public delegate int DelegateGetNumberOfDivers(int index);

    public delegate int DelegateGetOldNumberOfDivers(int index);

    public delegate int DelegateGetNumberOfJudges(int index);
    
    public delegate int DelegateGetOldNumberOfJudges(int index);

    public delegate Model.Contest DelegateGetContest(int index);
    
    public delegate Model.Contest DelegateGetOldContest(int index);

  

    public delegate void DelegateAddDiverToRegister(
        string name, string gender, string personalcodenumber, string nationality,
        string club, int index);

    public delegate void DelegateAddJudgeToRegister(
        string name, string gender, string personalcodenumber, string nationality,
        string affilliate, int index);

    public delegate BindingList<Model.Diver> DelegateGetDiverRegister(int rowOfContest);

    public delegate BindingList<Model.Diver> DelegateGetOldDiverRegister(int rowOfContest);

    public delegate BindingList<Model.Judge> DelegateGetJudgeRegister(int rowOfContest);

    public delegate BindingList<Model.Judge> DelegateGetOldJudgeRegister(int rowOfContest);

    public delegate BindingList<Model.Event> DelegateGetEventList(int rowOfContest);
    public delegate BindingList<Model.Event> DelegateGetOldEventList(int index);
    public delegate void DelegateAddEventToContest(
        int id, string gender, string bracket, double jumpHeight, int rounds, int maxDivers, int maxJudges,
        string startTime, string finishTime, bool couple, int index);

    public delegate void DelegateDeleteEventFromContest(int rowOfContest, int rowOfEvent);

    public delegate Model.ContestList DelegateGetContestList();

    public delegate Model.ContestList DelegateGetOldContestList();
    public delegate Model.Event DelegateGetEvent(int rowOfContest, int rowOfEvent);

    public delegate Model.Event DelegateGetOldEvent(int c, int e);

    public delegate BindingList<Model.DiverWithJumpCodes> DelegateGetSignedDiversToEvent(int rowOfContest, int rowOfEvent);

    public delegate void DelegateSaveContestListFromXmlFile(string fileName);

    public delegate void DelegateReadContestListFromXmlFile(string fileName);

    public delegate void DelegateReadOldContestListFromXmlFile(string filename);

    public delegate void DelegateSaveOldContestListToXmlFile(string filename);

    public delegate void DelegateSaveNewOldContest(Model.Contest c);

    
    public interface IFormMain
    {
        void SetContestList(BindingList<Model.Contest> contests);
        event DelegateNewContest EventNewContest;
        event DelegateDeleteContest EventDeleteContest;
        event DelegateStartContest EventStartContest;
        event DelegateSaveContestToXmlFile EventSaveContestToXmlFile;
        event DelegateGetNumberOfDivers EventGetNumberOfDivers;
        event DelegateGetNumberOfJudges EventGetNumberOfJudges;
        event DelegateGetContest EventGetContest;
        event DelegateAddDiverToRegister EventAddDiverToRegister;
        event DelegateAddJudgeToRegister EventAddJudgeToRegister;
        event DelegateGetDiverRegister EventGetDiverRegister;
        event DelegateGetJudgeRegister EventGetJudgeRegister;
        event DelegateAddEventToContest EventAddEventToContest;
        event DelegateGetEventList EventGetEventList;
        event DelegateDeleteEventFromContest EventDeleteEventFromContest;
        event DelegateGetContestList EventGetContestList;
        event DelegateGetOldContestList EventGetOldContestList;
        event DelegateGetEvent EventGetEvent;
        event DelegateGetSignedDiversToEvent EventGetSignedDiversToEvent;
        event DelegateSaveContestListFromXmlFile EventSaveContestListFromXmlFile;
        event DelegateReadContestListFromXmlFile EventReadContestListFromXmlFile;
        event DelegateReadContestFromXmlFile EventReadContestFromXmlFile;
        event DelegateReadOldContestListFromXmlFile EventReadOldContestListFromXmlFile;
        event DelegateSaveOldContestListToXmlFile EventSaveOldContestListToXmlFile;
        event DelegateSaveNewOldContest EventSaveNewOldContest;
        event DelegateGetOldDiverRegister EventGetOldDiverRegister;
        event DelegateGetOldJudgeRegister EventGetOldJudgeRegister;
        event DelegateGetOldNumberOfDivers EventGetOldNumberOfDivers;
        event DelegateGetOldNumberOfJudges EventGetOldNumberOfJudges;
        event DelegateGetOldContest EventGetOldContest;
        event DelegateGetOldEventList EventGetOldEventList;
        event DelegateGetOldEvent EventGetOldEvent;
    }
}